package com.ctshk.rpc.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ctshk.common.dto.Result;
import com.ctshk.rpc.user.entity.PassengerCertificates;
import com.ctshk.rpc.user.mapper.PassengerCertificatesMapper;
import com.ctshk.rpc.user.service.IPassengerCertificatesService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 *
 * </p>
 *
 * @author 李新科
 * @date 2021/5/17 11:29
 */
@DubboService
public class PassengerCertificatesServiceImpl extends ServiceImpl<PassengerCertificatesMapper, PassengerCertificates> implements IPassengerCertificatesService {

    @Autowired
    private PassengerCertificatesMapper passengerCertificatesMapper;

    @Override
    public Result delete(Long id, Long userId) {
        passengerCertificatesMapper.delete(new QueryWrapper<PassengerCertificates>()
                .lambda().eq(PassengerCertificates::getId, id)
                .eq(PassengerCertificates::getCreateId, userId));
        return Result.success();
    }
}
